/*
 * Brain.h
 *
 *  Created on: Dec 20, 2012
 *      Author: mark
 */

#ifndef BRAIN_H_
#define BRAIN_H_

#include "motorcontroller/motorcontroller.h"
#include "vectornav/vectornav.h"
#include "encoders/encoders.h"
#include "ping/ping.h"

#include <iostream>
#include <math.h>
#include <pthread.h>

using namespace std;

struct Vector2 {
	double x;
	double y;
};

class Brain {
private:
	MotorController		*motorcontroller;
	Vn100				vn100;
	Encoders			*encoders;
	Ping				*ping;
	Vector2				*position,	*destination;
	pthread_t			driveThread;

	double				yaw,		desiredYaw;

	double		CalculateDesiredYaw();
	void		Navigate();

public:
	Brain();
	virtual		~Brain();

	void		Drive();
};

#endif /* BRAIN_H_ */
